import 'package:flutter/material.dart';
import 'package:lai_zhan/common/config/Config.dart';
import 'package:lai_zhan/common/util/NavigatorUtil.dart';
import 'package:lai_zhan/common/style/AppStyle.dart';
import 'package:lai_zhan/common/model/userResult/user_result.dart';

class CoachItem extends StatelessWidget {

  UserResult coach;


  CoachItem({this.coach});

  @override
  Widget build(BuildContext context) {
    // TODO: implement build
    return new GestureDetector(
      child: new Column(
        children: <Widget>[
          new Container(color: Color(AppColors.lightWhite),
            padding: EdgeInsets.only(top: 10,bottom: 10,left: 15),
            child: new Row(
              crossAxisAlignment: CrossAxisAlignment.center,
              children: <Widget>[
                Container(margin: EdgeInsets.only(left: 5,right: 20),
                  child: ClipOval(child: FadeInImage.assetNetwork(placeholder: Config.DEFALUT_USER_ICON,
                    image: "",width: AppSize.getRealWidth(65),height: AppSize.getRealWidth(65),),),
                ),
                new Column(
                  crossAxisAlignment: CrossAxisAlignment.start,
                  mainAxisAlignment: MainAxisAlignment.center,
                  children: <Widget>[
                    new Text('叶大过',style: AppConstant.middleTextBold,),
                    new Padding(padding: EdgeInsets.all(3)),
                    new Row(
                      crossAxisAlignment: CrossAxisAlignment.center,
                      children: <Widget>[
                        new Container(width: AppSize.getRealWidth(30),
                          child: new Text('简介',style: AppConstant.smallTextBold,),),
                        new Padding(padding: EdgeInsets.all(3)),
                        new Container(width: AppSize.getRealWidth(150),
                          child: new Text('最好的锻炼是坚持',style: AppConstant.smallSubLightText,),)
                      ],),
                  ],
                )
              ],
            ),
          ),
        ],
      ),
      onTap: (){
        //跳转到教练界面
        NavigatorUtil.goCoachPage(context,coach);
      },
    );
  }
}